/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bea.cliente.gui.styles;

import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.builder.EffectBuilder;
import de.lessvoid.nifty.builder.HoverEffectBuilder;
import de.lessvoid.nifty.builder.StyleBuilder;

/**
 *
 * @author Ivan
 */
public class WindowStyles {

    public static String BLACK_STYLE = "blackStyle-window";

    public static void init(Nifty nifty) {
        /**
         * Configura o BLACK_STYLE
         */
        // #frame
        new StyleBuilder() {

            {
                id(BLACK_STYLE + "#frame");
                padding("8px");
                backgroundImage("Interface/styles/panel/bed-black-panel.png");
                imageMode("resize:32,162,32,32,32,162,32,160,32,162,32,32");
                childLayoutVertical();
            }
        }.build(nifty);
        // #bar
        new StyleBuilder() {

            {
                id(BLACK_STYLE + "#bar");
                width(percentage(100));
                height("20px");
                padding("2px");
                backgroundColor("#000f");
                childLayoutHorizontal();
            }
        }.build(nifty);
        // #title
        new StyleBuilder() {

            {
                id(BLACK_STYLE + "#title");
                base("base-font");
                width("*");
                height("20px");
                alignCenter();
                valignCenter();
                textHAlignCenter();
                textVAlignCenter();
                visibleToMouse(true);
                color("#ffff");
            }
        }.build(nifty);
        // #content
        new StyleBuilder() {

            {
                id(BLACK_STYLE + "#content");
                width(percentage(100));
                height("*");
                padding("8px");
                backgroundImage("Interface/styles/panel/bed-black-panel.png");
                imageMode("resize:32,162,32,32,32,162,32,160,32,162,32,32");
                childLayoutCenter();
            }
        }.build(nifty);
        // #close-button
        new StyleBuilder() {

            {
                id(BLACK_STYLE + "#close-button");
                backgroundImage("Interface/styles/window/window-close-button.png");
                width("16px");
                height("16px");
                alignCenter();
                valignCenter();
                onHoverEffect(new HoverEffectBuilder("imageOverlay") {

                    {
                        effectParameter("filename", "Interface/styles/window/window-close-button-hover.png");
                        post(true);
                    }
                });
            }
        }.build(nifty);
    }
}
